USE [AnotherSuccessfulProcedure]

IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id(N'[dbo].[CustomKillSelectCountByPlayerIdLogId]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
BEGIN
	DROP PROCEDURE dbo.CustomKillSelectCountByPlayerIdLogId
END


SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Neil Wilson
-- Create date: 09/03/08
-- Description:	CustomKills Table Select Count By PlayerId and LogId
-- =============================================
CREATE PROCEDURE CustomKillSelectCountByPlayerIdLogId

            @LogId int,
			@PlayerId varchar(30),
			@CustomKillType varchar(30),
			@CustomKillCount int = 0 OUTPUT
	
AS

BEGIN

select @CustomKillCount = COUNT(KillId) FROM Kills
		WHERE LogId = @LogId
		AND Attacker_PlayerId = @PlayerId
		AND CustomKillId = (SELECT CustomKillId FROM CustomKills WHERE CustomKillShortName = @CustomKillType)


END
GO


